{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# <center>零售业数据分析系</center>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> <h1>项目背景</h1>\n",
    "- 此次项目数据来自Kaggle，包含了2010年12月1日至2011年12月9日在英国注册的非实体网上零售发生的所有交易。公司主要销售独特的全天候礼品。该公司的许多客户都是批发商。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 字段介绍\n",
    "- InvoiceNo: 订单编号，每笔交易有6个整数，退货订单编号开头有字母'C'。\n",
    "- StockCode: 产品编号，由5个整数组成。\n",
    "- Description: 产品描述。\n",
    "- Quantity: 产品数量，有负号的表示退货\n",
    "- InvoiceDate: 订单日期和时间。\n",
    "- UnitPrice: 单价（英镑），单位产品的价格。\n",
    "- CustomerID:客户编号，每个客户编号由5位数字组成。\n",
    "- Country: 国家的名称，每个客户所在国家/地区的名称。\n",
    "\n",
    "> 问题\n",
    "- 1.购买商品数前十的国家是？\n",
    "- 2.交易额前十的国家是？\n",
    "- 3.哪些月份销量较佳？\n",
    "- 4.客单价多少？\n",
    "- 5.用户消费行为分析\n",
    "- 6.销售量前十国家的成功购买率"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 导入数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "# import warnings\n",
    "# warnings.filterwarnings(\"ignore\")\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Grid, Line,Scatter,Pie,Tab\n",
    "from pyecharts.components import Table\n",
    "#LIGHT DARK CHALK ESSOS PURPLE_PASSION\n",
    "from pyecharts.globals import ThemeType\n",
    "# 设置中文标签的显示\n",
    "plt.rcParams['font.sans-serif'] = ['SimHei']  #设置显示中文字体"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>订单编号</th>\n",
       "      <th>产品编号</th>\n",
       "      <th>产品描述</th>\n",
       "      <th>产品数量</th>\n",
       "      <th>订单日期和时间</th>\n",
       "      <th>单价(英镑)</th>\n",
       "      <th>客户编号</th>\n",
       "      <th>国家的名称</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>InvoiceNo</td>\n",
       "      <td>StockCode</td>\n",
       "      <td>Description</td>\n",
       "      <td>Quantity</td>\n",
       "      <td>InvoiceDate</td>\n",
       "      <td>UnitPrice</td>\n",
       "      <td>CustomerID</td>\n",
       "      <td>Country</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>536365</td>\n",
       "      <td>85123A</td>\n",
       "      <td>WHITE HANGING HEART T-LIGHT HOLDER</td>\n",
       "      <td>6</td>\n",
       "      <td>12/1/2010 8:26</td>\n",
       "      <td>2.55</td>\n",
       "      <td>17850.0</td>\n",
       "      <td>United Kingdom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>536365</td>\n",
       "      <td>71053</td>\n",
       "      <td>WHITE METAL LANTERN</td>\n",
       "      <td>6</td>\n",
       "      <td>12/1/2010 8:26</td>\n",
       "      <td>3.39</td>\n",
       "      <td>17850.0</td>\n",
       "      <td>United Kingdom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>536365</td>\n",
       "      <td>84406B</td>\n",
       "      <td>CREAM CUPID HEARTS COAT HANGER</td>\n",
       "      <td>8</td>\n",
       "      <td>12/1/2010 8:26</td>\n",
       "      <td>2.75</td>\n",
       "      <td>17850.0</td>\n",
       "      <td>United Kingdom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>536365</td>\n",
       "      <td>84029G</td>\n",
       "      <td>KNITTED UNION FLAG HOT WATER BOTTLE</td>\n",
       "      <td>6</td>\n",
       "      <td>12/1/2010 8:26</td>\n",
       "      <td>3.39</td>\n",
       "      <td>17850.0</td>\n",
       "      <td>United Kingdom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>541905</th>\n",
       "      <td>581587</td>\n",
       "      <td>22613</td>\n",
       "      <td>PACK OF 20 SPACEBOY NAPKINS</td>\n",
       "      <td>12</td>\n",
       "      <td>12/9/2011 12:50</td>\n",
       "      <td>0.85</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>541906</th>\n",
       "      <td>581587</td>\n",
       "      <td>22899</td>\n",
       "      <td>CHILDREN'S APRON DOLLY GIRL</td>\n",
       "      <td>6</td>\n",
       "      <td>12/9/2011 12:50</td>\n",
       "      <td>2.1</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>541907</th>\n",
       "      <td>581587</td>\n",
       "      <td>23254</td>\n",
       "      <td>CHILDRENS CUTLERY DOLLY GIRL</td>\n",
       "      <td>4</td>\n",
       "      <td>12/9/2011 12:50</td>\n",
       "      <td>4.15</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>541908</th>\n",
       "      <td>581587</td>\n",
       "      <td>23255</td>\n",
       "      <td>CHILDRENS CUTLERY CIRCUS PARADE</td>\n",
       "      <td>4</td>\n",
       "      <td>12/9/2011 12:50</td>\n",
       "      <td>4.15</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>541909</th>\n",
       "      <td>581587</td>\n",
       "      <td>22138</td>\n",
       "      <td>BAKING SET 9 PIECE RETROSPOT</td>\n",
       "      <td>3</td>\n",
       "      <td>12/9/2011 12:50</td>\n",
       "      <td>4.95</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>541910 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             订单编号       产品编号                                 产品描述      产品数量  \\\n",
       "0       InvoiceNo  StockCode                          Description  Quantity   \n",
       "1          536365     85123A   WHITE HANGING HEART T-LIGHT HOLDER         6   \n",
       "2          536365      71053                  WHITE METAL LANTERN         6   \n",
       "3          536365     84406B       CREAM CUPID HEARTS COAT HANGER         8   \n",
       "4          536365     84029G  KNITTED UNION FLAG HOT WATER BOTTLE         6   \n",
       "...           ...        ...                                  ...       ...   \n",
       "541905     581587      22613          PACK OF 20 SPACEBOY NAPKINS        12   \n",
       "541906     581587      22899         CHILDREN'S APRON DOLLY GIRL          6   \n",
       "541907     581587      23254        CHILDRENS CUTLERY DOLLY GIRL          4   \n",
       "541908     581587      23255      CHILDRENS CUTLERY CIRCUS PARADE         4   \n",
       "541909     581587      22138        BAKING SET 9 PIECE RETROSPOT          3   \n",
       "\n",
       "                订单日期和时间     单价(英镑)        客户编号           国家的名称  \n",
       "0           InvoiceDate  UnitPrice  CustomerID         Country  \n",
       "1        12/1/2010 8:26       2.55     17850.0  United Kingdom  \n",
       "2        12/1/2010 8:26       3.39     17850.0  United Kingdom  \n",
       "3        12/1/2010 8:26       2.75     17850.0  United Kingdom  \n",
       "4        12/1/2010 8:26       3.39     17850.0  United Kingdom  \n",
       "...                 ...        ...         ...             ...  \n",
       "541905  12/9/2011 12:50       0.85     12680.0          France  \n",
       "541906  12/9/2011 12:50        2.1     12680.0          France  \n",
       "541907  12/9/2011 12:50       4.15     12680.0          France  \n",
       "541908  12/9/2011 12:50       4.15     12680.0          France  \n",
       "541909  12/9/2011 12:50       4.95     12680.0          France  \n",
       "\n",
       "[541910 rows x 8 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "film_date=pd.read_csv(\"data.csv\",encoding=\"utf-8\",header=None,names=['订单编号','产品编号','产品描述','产品数量','订单日期和时间','单价(英镑)','客户编号','国家的名称'],low_memory=False)\n",
    "film_date"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\program files\\python\\lib\\site-packages\\ipykernel_launcher.py:4: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  after removing the cwd from sys.path.\n",
      "d:\\program files\\python\\lib\\site-packages\\pandas\\core\\indexing.py:1781: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  self.obj[item_labels[indexer[info_axis]]] = value\n",
      "d:\\program files\\python\\lib\\site-packages\\pandas\\core\\indexing.py:1743: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  isetter(ilocs[0], value)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>订单编号</th>\n",
       "      <th>产品编号</th>\n",
       "      <th>产品描述</th>\n",
       "      <th>产品数量</th>\n",
       "      <th>订单日期和时间</th>\n",
       "      <th>单价(英镑)</th>\n",
       "      <th>客户编号</th>\n",
       "      <th>国家的名称</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>536365</td>\n",
       "      <td>71053</td>\n",
       "      <td>WHITE METAL LANTERN</td>\n",
       "      <td>6</td>\n",
       "      <td>2010-12-01</td>\n",
       "      <td>3.39</td>\n",
       "      <td>17850.0</td>\n",
       "      <td>United Kingdom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>536365</td>\n",
       "      <td>22752</td>\n",
       "      <td>SET 7 BABUSHKA NESTING BOXES</td>\n",
       "      <td>2</td>\n",
       "      <td>2010-12-01</td>\n",
       "      <td>7.65</td>\n",
       "      <td>17850.0</td>\n",
       "      <td>United Kingdom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>536365</td>\n",
       "      <td>21730</td>\n",
       "      <td>GLASS STAR FROSTED T-LIGHT HOLDER</td>\n",
       "      <td>6</td>\n",
       "      <td>2010-12-01</td>\n",
       "      <td>4.25</td>\n",
       "      <td>17850.0</td>\n",
       "      <td>United Kingdom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>536366</td>\n",
       "      <td>22633</td>\n",
       "      <td>HAND WARMER UNION JACK</td>\n",
       "      <td>6</td>\n",
       "      <td>2010-12-01</td>\n",
       "      <td>1.85</td>\n",
       "      <td>17850.0</td>\n",
       "      <td>United Kingdom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>536366</td>\n",
       "      <td>22632</td>\n",
       "      <td>HAND WARMER RED POLKA DOT</td>\n",
       "      <td>6</td>\n",
       "      <td>2010-12-01</td>\n",
       "      <td>1.85</td>\n",
       "      <td>17850.0</td>\n",
       "      <td>United Kingdom</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>371015</th>\n",
       "      <td>581587</td>\n",
       "      <td>22613</td>\n",
       "      <td>PACK OF 20 SPACEBOY NAPKINS</td>\n",
       "      <td>12</td>\n",
       "      <td>2011-12-09</td>\n",
       "      <td>0.85</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>371016</th>\n",
       "      <td>581587</td>\n",
       "      <td>22899</td>\n",
       "      <td>CHILDREN'S APRON DOLLY GIRL</td>\n",
       "      <td>6</td>\n",
       "      <td>2011-12-09</td>\n",
       "      <td>2.10</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>371017</th>\n",
       "      <td>581587</td>\n",
       "      <td>23254</td>\n",
       "      <td>CHILDRENS CUTLERY DOLLY GIRL</td>\n",
       "      <td>4</td>\n",
       "      <td>2011-12-09</td>\n",
       "      <td>4.15</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>371018</th>\n",
       "      <td>581587</td>\n",
       "      <td>23255</td>\n",
       "      <td>CHILDRENS CUTLERY CIRCUS PARADE</td>\n",
       "      <td>4</td>\n",
       "      <td>2011-12-09</td>\n",
       "      <td>4.15</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>371019</th>\n",
       "      <td>581587</td>\n",
       "      <td>22138</td>\n",
       "      <td>BAKING SET 9 PIECE RETROSPOT</td>\n",
       "      <td>3</td>\n",
       "      <td>2011-12-09</td>\n",
       "      <td>4.95</td>\n",
       "      <td>12680.0</td>\n",
       "      <td>France</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>371020 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          订单编号   产品编号                               产品描述  产品数量     订单日期和时间  \\\n",
       "0       536365  71053                WHITE METAL LANTERN     6  2010-12-01   \n",
       "1       536365  22752       SET 7 BABUSHKA NESTING BOXES     2  2010-12-01   \n",
       "2       536365  21730  GLASS STAR FROSTED T-LIGHT HOLDER     6  2010-12-01   \n",
       "3       536366  22633             HAND WARMER UNION JACK     6  2010-12-01   \n",
       "4       536366  22632          HAND WARMER RED POLKA DOT     6  2010-12-01   \n",
       "...        ...    ...                                ...   ...         ...   \n",
       "371015  581587  22613        PACK OF 20 SPACEBOY NAPKINS    12  2011-12-09   \n",
       "371016  581587  22899       CHILDREN'S APRON DOLLY GIRL      6  2011-12-09   \n",
       "371017  581587  23254      CHILDRENS CUTLERY DOLLY GIRL      4  2011-12-09   \n",
       "371018  581587  23255    CHILDRENS CUTLERY CIRCUS PARADE     4  2011-12-09   \n",
       "371019  581587  22138      BAKING SET 9 PIECE RETROSPOT      3  2011-12-09   \n",
       "\n",
       "        单价(英镑)     客户编号           国家的名称  \n",
       "0         3.39  17850.0  United Kingdom  \n",
       "1         7.65  17850.0  United Kingdom  \n",
       "2         4.25  17850.0  United Kingdom  \n",
       "3         1.85  17850.0  United Kingdom  \n",
       "4         1.85  17850.0  United Kingdom  \n",
       "...        ...      ...             ...  \n",
       "371015    0.85  12680.0          France  \n",
       "371016    2.10  12680.0          France  \n",
       "371017    4.15  12680.0          France  \n",
       "371018    4.15  12680.0          France  \n",
       "371019    4.95  12680.0          France  \n",
       "\n",
       "[371020 rows x 8 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "# 产品编号---保证产品编号是5位纯数字\n",
    "film_date=film_date[film_date['产品编号'].apply(lambda x: x.isdigit())]\n",
    "#删除存在的空行数据\n",
    "film_date.dropna(axis=0,how='any',inplace=True)\n",
    "# 将客户编号转化成str\n",
    "film_date.loc[:,\"客户编号\"]=film_date[\"客户编号\"].astype(np.str)\n",
    "# 转化成标准的时间类型\n",
    "film_date.loc[:,'订单日期和时间'] = pd.to_datetime(film_date['订单日期和时间'])\n",
    "# 提取日期部分\n",
    "film_date.loc[:,'订单日期和时间'] = film_date['订单日期和时间'].dt.date\n",
    "#对产品数量的数据类型进行处理\n",
    "film_date.loc[:,\"产品数量\"]=film_date[\"产品数量\"].astype(np.int64)\n",
    "#对产品价格的数据类型进行处理\n",
    "film_date.loc[:,\"单价(英镑)\"]=film_date[\"单价(英镑)\"].astype(np.float64)\n",
    "# 重新设置index\n",
    "film_date=film_date.reset_index().drop(\"index\",axis=1)\n",
    "# 产品数量大于0\n",
    "film_da=film_date[film_date[\"产品数量\"]>0].copy()\n",
    "# 产品数量大于0\n",
    "film_xiao=film_date[film_date[\"产品数量\"]<0].copy()\n",
    "film_date"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 1.购买商品数前十的国家是？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>国家的名称</th>\n",
       "      <th>产品数量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>3907657</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Netherlands</td>\n",
       "      <td>193375</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>EIRE</td>\n",
       "      <td>131470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Germany</td>\n",
       "      <td>111640</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>France</td>\n",
       "      <td>106432</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Australia</td>\n",
       "      <td>82095</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>35316</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>27847</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Japan</td>\n",
       "      <td>25356</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Spain</td>\n",
       "      <td>23112</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            国家的名称     产品数量\n",
       "0  United Kingdom  3907657\n",
       "1     Netherlands   193375\n",
       "2            EIRE   131470\n",
       "3         Germany   111640\n",
       "4          France   106432\n",
       "5       Australia    82095\n",
       "6          Sweden    35316\n",
       "7     Switzerland    27847\n",
       "8           Japan    25356\n",
       "9           Spain    23112"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#通过国家和产品数量来统计得出排名前十的国家\n",
    "data=film_da\n",
    "list=data.groupby(\"国家的名称\",as_index=False)[\"产品数量\"].sum()\n",
    "list.sort_values(by=\"产品数量\",ascending=False,inplace=True)\n",
    "list=list.head(10).reset_index().drop(\"index\",axis=1)\n",
    "# type(list)\n",
    "# np.array(list[\"国家的名称\"]).tolist()\n",
    "list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"21e433f538e0487494da978f1ee595df\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_21e433f538e0487494da978f1ee595df = echarts.init(\n",
       "                    document.getElementById('21e433f538e0487494da978f1ee595df'), 'white', {renderer: 'canvas'});\n",
       "                var option_21e433f538e0487494da978f1ee595df = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"United Kingdom\",\n",
       "                    \"value\": 3907657\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Netherlands\",\n",
       "                    \"value\": 193375\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"EIRE\",\n",
       "                    \"value\": 131470\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Germany\",\n",
       "                    \"value\": 111640\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"France\",\n",
       "                    \"value\": 106432\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Australia\",\n",
       "                    \"value\": 82095\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Sweden\",\n",
       "                    \"value\": 35316\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Switzerland\",\n",
       "                    \"value\": 27847\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Japan\",\n",
       "                    \"value\": 25356\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Spain\",\n",
       "                    \"value\": 23112\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}:{d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"United Kingdom\",\n",
       "                \"Netherlands\",\n",
       "                \"EIRE\",\n",
       "                \"Germany\",\n",
       "                \"France\",\n",
       "                \"Australia\",\n",
       "                \"Sweden\",\n",
       "                \"Switzerland\",\n",
       "                \"Japan\",\n",
       "                \"Spain\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"2%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u9500\\u552e\\u91cf\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_21e433f538e0487494da978f1ee595df.setOption(option_21e433f538e0487494da978f1ee595df);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x6133dd0>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#饼图 #LIGHT DARK CHALK ESSOS PURPLE_PASSION\n",
    "pie=Pie().add(\"\",list.values.tolist())\n",
    "# pie.set_colors([\"orange\", \"green\", \"yellow\", \"red\", \"pink\", \"orange\", \"purple\"])\n",
    "# pie.set_series_opts(label_opts=opts.LabelOpts(is_show=False))#是否显示调试线\n",
    "pie.set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"销售量排名前十的国家\"),\n",
    "            legend_opts=opts.LegendOpts(\n",
    "                orient=\"vertical\", pos_top=\"15%\", pos_left=\"2%\"\n",
    "            ),\n",
    "    \n",
    "        ).set_series_opts(label_opts=opts.LabelOpts(formatter='{b}:{d}%'))\n",
    "pie.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 分析\n",
    "\n",
    "1.从饼图中可以清楚的看出销售额排名前十的国家分别是：United Kingdom，Netherlands，EIRE，Germany，France，Australia，Sweden，Switzerland，Japan，Spain；其中销售量最多的国家是United Kingdom，总销售量都达到了390.7657万件，销售量最低的国家是Spain，总销售量是2.3112万件。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 2. 交易额前十的国家是？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>国家的名称</th>\n",
       "      <th>销售额</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>6.623368e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Netherlands</td>\n",
       "      <td>2.693302e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>EIRE</td>\n",
       "      <td>2.426983e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Germany</td>\n",
       "      <td>1.902019e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>France</td>\n",
       "      <td>1.735321e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Australia</td>\n",
       "      <td>1.340706e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>4.810933e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Spain</td>\n",
       "      <td>4.304619e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Japan</td>\n",
       "      <td>3.597517e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>3.512805e+04</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            国家的名称           销售额\n",
       "0  United Kingdom  6.623368e+06\n",
       "1     Netherlands  2.693302e+05\n",
       "2            EIRE  2.426983e+05\n",
       "3         Germany  1.902019e+05\n",
       "4          France  1.735321e+05\n",
       "5       Australia  1.340706e+05\n",
       "6     Switzerland  4.810933e+04\n",
       "7           Spain  4.304619e+04\n",
       "8           Japan  3.597517e+04\n",
       "9          Sweden  3.512805e+04"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#通过产品数量和单价计算出销售额，排序之后得出排名前十的国家\n",
    "# data4 = film_date.dropna(how='all')\n",
    "data1=film_da\n",
    "data1.loc[:,\"销售额\"]=(data1[\"产品数量\"]*data1[\"单价(英镑)\"])\n",
    "list_sales=data1.groupby(data1[\"国家的名称\"],as_index=False)[\"销售额\"].sum()\n",
    "list_sales=list_sales.sort_values(by=\"销售额\",ascending=False)\n",
    "list_sales=list_sales.head(10).reset_index().drop(\"index\",axis=1)\n",
    "list_sales"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"3bb2e752c40443beb06bdd5b050f0db7\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_3bb2e752c40443beb06bdd5b050f0db7 = echarts.init(\n",
       "                    document.getElementById('3bb2e752c40443beb06bdd5b050f0db7'), 'white', {renderer: 'canvas'});\n",
       "                var option_3bb2e752c40443beb06bdd5b050f0db7 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u9500\\u552e\\u989d\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\",\n",
       "            \"data\": [\n",
       "                6623368.43,\n",
       "                269330.18,\n",
       "                242698.34,\n",
       "                190201.94,\n",
       "                173532.12,\n",
       "                134070.62,\n",
       "                48109.33,\n",
       "                43046.19,\n",
       "                35975.17,\n",
       "                35128.05\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 20,\n",
       "                \"fontStyle\": \"italic\"\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5927\\u503c\",\n",
       "                        \"type\": \"max\"\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5c0f\\u503c\",\n",
       "                        \"type\": \"min\"\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u5e73\\u5747\\u503c\",\n",
       "                        \"type\": \"average\"\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u9500\\u552e\\u989d\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u9500\\u552e\\u989d\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u56fd\\u5bb6\\u7684\\u540d\\u79f0\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"rotate\": 15,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"United Kingdom\",\n",
       "                \"Netherlands\",\n",
       "                \"EIRE\",\n",
       "                \"Germany\",\n",
       "                \"France\",\n",
       "                \"Australia\",\n",
       "                \"Switzerland\",\n",
       "                \"Spain\",\n",
       "                \"Japan\",\n",
       "                \"Sweden\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u9500\\u552e\\u989d(\\u82f1\\u9551)\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u4ea4\\u6613\\u989d\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false\n",
       "    }\n",
       "};\n",
       "                chart_3bb2e752c40443beb06bdd5b050f0db7.setOption(option_3bb2e752c40443beb06bdd5b050f0db7);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x12f50410>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#柱形图\n",
    "bar = Bar()\n",
    "bar.add_xaxis(np.array(list_sales[\"国家的名称\"]).tolist())\n",
    "bar.add_yaxis(\"销售额排名前十的国家\",np.array(list_sales[\"销售额\"]).round(2).tolist())\n",
    "bar.set_global_opts(title_opts=opts.TitleOpts(title=\"交易额排名前十的国家\"),\n",
    "#                     toolbox_opts=opts.ToolboxOpts(),\n",
    "                    datazoom_opts=opts.DataZoomOpts(is_show=True),\n",
    "                   yaxis_opts=opts.AxisOpts(\n",
    "                    name='销售额(英镑)'),\n",
    "                    xaxis_opts=opts.AxisOpts(\n",
    "                    name='国家的名称',axislabel_opts=opts.LabelOpts(rotate=15))\n",
    "                    \n",
    "                   )\n",
    "bar.set_series_opts(label_opts=opts.LabelOpts(font_size=20,font_style=\"italic\"),\n",
    "            markline_opts=opts.MarkLineOpts(\n",
    "                data=[\n",
    "                    opts.MarkLineItem(type_=\"max\", name=\"最大值\"),\n",
    "                    opts.MarkLineItem(type_=\"min\", name=\"最小值\"),\n",
    "                    opts.MarkLineItem(type_=\"average\", name=\"平均值\"),\n",
    "                ]\n",
    "            ))\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 1.从柱状图中可以清楚的看出销售额排名前十的国家分别是：United Kingdom，Netherlands，EIRE，Germany，France，Australia，Switzerland，Spain，\n",
    "Japan，Sweden；从中可以清楚的看出，销售量和销售额成正比，销售量高的国家对应的销售额也比较高。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 3.哪些月份销量较佳？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\program files\\python\\lib\\site-packages\\ipykernel_launcher.py:5: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  \"\"\"\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>month</th>\n",
       "      <th>产品数量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>238707</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>240684</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>312207</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>250371</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>338177</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>329235</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>332333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>355492</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>501976</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>531816</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>620358</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>191572</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    month    产品数量\n",
       "0       1  238707\n",
       "1       2  240684\n",
       "2       3  312207\n",
       "3       4  250371\n",
       "4       5  338177\n",
       "5       6  329235\n",
       "6       7  332333\n",
       "7       8  355492\n",
       "8       9  501976\n",
       "9      10  531816\n",
       "10     11  620358\n",
       "11     12  191572"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2=film_date\n",
    "# 添加月份列，对产品数量进行统计\n",
    "data2['订单日期和时间']=data2['订单日期和时间'].astype(np.str)\n",
    "data2=data2[data2['订单日期和时间']>'2010-12-30']\n",
    "data2['month']= pd.to_datetime(data2['订单日期和时间']).dt.month\n",
    "list_month_sales=data2.groupby(data2[\"month\"],as_index=False)[\"产品数量\"].sum()\n",
    "list_month_sales=list_month_sales.sort_values(by=\"month\",ascending=True)\n",
    "list_month_sales=list_month_sales.reset_index().drop(\"index\",axis=1)\n",
    "list_month_sales"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"843b5919e94d401aac9dbccd5fda202b\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_843b5919e94d401aac9dbccd5fda202b = echarts.init(\n",
       "                    document.getElementById('843b5919e94d401aac9dbccd5fda202b'), 'white', {renderer: 'canvas'});\n",
       "                var option_843b5919e94d401aac9dbccd5fda202b = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": 1,\n",
       "                    \"value\": 238707\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 2,\n",
       "                    \"value\": 240684\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 3,\n",
       "                    \"value\": 312207\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 4,\n",
       "                    \"value\": 250371\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 5,\n",
       "                    \"value\": 338177\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 6,\n",
       "                    \"value\": 329235\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 7,\n",
       "                    \"value\": 332333\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 8,\n",
       "                    \"value\": 355492\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 9,\n",
       "                    \"value\": 501976\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 10,\n",
       "                    \"value\": 531816\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 11,\n",
       "                    \"value\": 620358\n",
       "                },\n",
       "                {\n",
       "                    \"name\": 12,\n",
       "                    \"value\": 191572\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"30%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"60%\"\n",
       "            ],\n",
       "            \"roseType\": \"radius\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\\u6708:{d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                1,\n",
       "                2,\n",
       "                3,\n",
       "                4,\n",
       "                5,\n",
       "                6,\n",
       "                7,\n",
       "                8,\n",
       "                9,\n",
       "                10,\n",
       "                11,\n",
       "                12\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"2%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"2011\\u5168\\u5e74\\u7684\\u9500\\u552e\\u91cf\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_843b5919e94d401aac9dbccd5fda202b.setOption(option_843b5919e94d401aac9dbccd5fda202b);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11467970>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pie=Pie().add(\n",
    "            \"\",\n",
    "            list_month_sales.values.tolist(),\n",
    "            radius=[\"30%\", \"75%\"],\n",
    "            center=[\"50%\", \"60%\"],\n",
    "            rosetype=\"radius\",\n",
    "            label_opts=opts.LabelOpts(is_show=True),\n",
    "        ).set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"2011全年的销售量\"),\n",
    "            legend_opts=opts.LegendOpts(\n",
    "                orient=\"vertical\", pos_top=\"15%\", pos_left=\"2%\",\n",
    "                \n",
    "            )\n",
    "        ).set_series_opts(label_opts=opts.LabelOpts(formatter='{b}月:{d}%'))\n",
    "pie.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 从玫瑰图中可以看出来，销售较佳的月份是11月和10月份，在这个是时间段批发商正在采购圣诞节所需要的产品，所以销售量会特别高。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 4.客单价多少？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1857.55"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#用销售总额除以顾客数得出客单价（客单价=销售额/用户数量）\n",
    "data3=film_da\n",
    "price=data3[\"销售额\"].sum()\n",
    "user=data3.groupby(\"客户编号\",as_index=False)[\"销售额\"].sum()\n",
    "# data3[\"客户编号\"]=data3[\"客户编号\"].drop_duplicates().reset_index().drop('index',axis=1)\n",
    "user=len(user[\"客户编号\"])\n",
    "user_price=(price/user).round(2)\n",
    "user_price\n",
    "# user\n",
    "# price"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 总体上看批发商的年平均消费水平为1857.55英镑,销售额是由客单价和用户数所决定的，要提升产品的销售额，除了尽可能多地吸引客流，增加顾客交易次数以外，提高客单价也是非常重要的途径"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 5.用户消费行为分析\n",
    "   - 圣诞节前后被成功购买数量最多的前十个产品\n",
    "   - 圣诞节前后被退货数量最多的前十个产品"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### RFM模型分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'pd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-1-5f899e7d5b16>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;31m# 这三个指标可以将我们的用户划分成不同的等级和层次，目的是为了衡量他们的用户价值，从而能够更准确地将成本和精力花在更精确的用户层次身上。\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;31m# 一个典型的例子就是针对一个明显无意愿的流失用户，对其继续push自己的核心产品，费时费力也费钱。\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[0mfilm_da\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'订单日期和时间'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mto_datetime\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfilm_da\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'订单日期和时间'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      5\u001b[0m \u001b[0mfilm_da\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'距离当前的时间'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mto_datetime\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'today'\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m-\u001b[0m \u001b[0mfilm_da\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'订单日期和时间'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdt\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdays\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      6\u001b[0m \u001b[1;31m# 取最近一次的消费时间\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'pd' is not defined"
     ]
    }
   ],
   "source": [
    "# RFM模型即\"R\"——Recency（最近一次消费时间）、\"F\"——Frequency（一段时间内消费频次）、\"M\"——（一段时间内消费总额）。\n",
    "# 这三个指标可以将我们的用户划分成不同的等级和层次，目的是为了衡量他们的用户价值，从而能够更准确地将成本和精力花在更精确的用户层次身上。\n",
    "# 一个典型的例子就是针对一个明显无意愿的流失用户，对其继续push自己的核心产品，费时费力也费钱。\n",
    "film_da['订单日期和时间'] = pd.to_datetime(film_da['订单日期和时间'])\n",
    "film_da['距离当前的时间'] = (pd.to_datetime('today') - film_da['订单日期和时间']).dt.days\n",
    "# 取最近一次的消费时间\n",
    "R_Agg = film_da.groupby(by=['客户编号'])['距离当前的时间']\n",
    "R_Agg = R_Agg.agg([('最近一次消费','min')])\n",
    "# 查看客户的消费频次\n",
    "F_Agg = film_da.groupby(by=['客户编号'])['订单编号']\n",
    "F_Agg = F_Agg.agg([('2010年消费频次','count')])\n",
    "# 对客户的消费金额进行累计加和\n",
    "M_Agg = film_da.groupby(by=['客户编号'])['销售额']\n",
    "M_Agg = M_Agg.agg([('2010年消费金额',sum)])\n",
    "rfm = R_Agg.join(F_Agg).join(M_Agg)\n",
    "def rfm_convert(x):\n",
    "    rfm_dict = {0:'R',\n",
    "                1:'F',\n",
    "                2:'M'}\n",
    "    try:\n",
    "#         对最近一次消费,2010年消费金额列进行6分位数的计算\n",
    "        for i in range(0,3,1):\n",
    "            bins = x.iloc[:,i].quantile(q=np.linspace(0,1,num=6),interpolation='nearest')\n",
    "#             求出被切割后的区间\n",
    "# q=array([0. , 0.2, 0.4, 0.6, 0.8, 1. ])\n",
    "            print(bins)\n",
    "            if i == 0:\n",
    "#             倒序所以，反着排\n",
    "                labels = np.arange(5,0,-1)\n",
    "            else :\n",
    "                labels = np.arange(1,6)\n",
    "            x[rfm_dict[i]] = pd.cut(x.iloc[:,i],bins=bins,labels=labels,include_lowest=True)\n",
    "    except Exception as e:\n",
    "        print(e)\n",
    "rfm_convert(rfm)\n",
    "# 过滤掉出rfm之外的列\n",
    "rfm_model = rfm.filter(items=['R','F','M'])\n",
    "def rfm(x):\n",
    "    return x.iloc[0]*3+x.iloc[1]+x.iloc[2]*3\n",
    "rfm_model['RFM'] = rfm_model.apply(rfm,axis=1)#对每一行进行rfm函数运算\n",
    "bins = rfm_model.RFM.quantile(q=np.linspace(0,1,num=9),interpolation='nearest')\n",
    "labels = ['流失客户','一般维持客户','新客户','潜力客户','重要挽留客户','重要深跟客户','重要唤回客户','重要价值客户']\n",
    "rfm_model['Label of Customer'] = pd.cut(rfm_model.RFM, bins=bins, labels=labels, include_lowest=True)#include_lowest：bool型的参数，表示区间的左边是开还是闭的，默认为false，也就是不包含区间左部（闭）\n",
    "# rfm_model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"8db77af6276f4fffa0a4a2c50b80c072\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_8db77af6276f4fffa0a4a2c50b80c072 = echarts.init(\n",
       "                    document.getElementById('8db77af6276f4fffa0a4a2c50b80c072'), 'white', {renderer: 'canvas'});\n",
       "                var option_8db77af6276f4fffa0a4a2c50b80c072 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u6d41\\u5931\\u5ba2\\u6237\",\n",
       "                    \"value\": 557\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e00\\u822c\\u7ef4\\u6301\\u5ba2\\u6237\",\n",
       "                    \"value\": 599\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65b0\\u5ba2\\u6237\",\n",
       "                    \"value\": 630\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6f5c\\u529b\\u5ba2\\u6237\",\n",
       "                    \"value\": 480\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u8981\\u633d\\u7559\\u5ba2\\u6237\",\n",
       "                    \"value\": 451\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u8981\\u6df1\\u8ddf\\u5ba2\\u6237\",\n",
       "                    \"value\": 593\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u8981\\u5524\\u56de\\u5ba2\\u6237\",\n",
       "                    \"value\": 619\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u8981\\u4ef7\\u503c\\u5ba2\\u6237\",\n",
       "                    \"value\": 386\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"30%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"60%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"radius\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}:{d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6d41\\u5931\\u5ba2\\u6237\",\n",
       "                \"\\u4e00\\u822c\\u7ef4\\u6301\\u5ba2\\u6237\",\n",
       "                \"\\u65b0\\u5ba2\\u6237\",\n",
       "                \"\\u6f5c\\u529b\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u633d\\u7559\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u6df1\\u8ddf\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u5524\\u56de\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u4ef7\\u503c\\u5ba2\\u6237\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"0%\",\n",
       "            \"top\": \"30%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6d88\\u8d39\\u8005\\u5206\\u5c42\\u7ed3\\u6784\",\n",
       "            \"left\": \"center\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_8db77af6276f4fffa0a4a2c50b80c072.setOption(option_8db77af6276f4fffa0a4a2c50b80c072);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x12bc9e90>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tmp = rfm_model.groupby('Label of Customer',as_index=False).size()\n",
    "tmp\n",
    "# t = [list(z) for z in zip(tmp.index.values, tmp.values)]\n",
    "# # 绘制饼图\n",
    "pie = (\n",
    "    Pie()\n",
    "    .add('',tmp.values.tolist(),\n",
    "     radius=['30%','75%'],\n",
    "     center=[\"60%\", \"50%\"],\n",
    "     rosetype='radius',\n",
    "     label_opts=opts.LabelOpts(is_show=True))\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title='消费者分层结构',pos_left='center'),\n",
    "#                      toolbox_opts=opts.ToolboxOpts(is_show=True),\n",
    "                     legend_opts=opts.LegendOpts(orient='vertical',pos_left='0%',pos_top='30%'))\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter='{b}:{d}%')))\n",
    "pie.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"4926cabf193b4fc0b9da58051018dff7\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_4926cabf193b4fc0b9da58051018dff7 = echarts.init(\n",
       "                    document.getElementById('4926cabf193b4fc0b9da58051018dff7'), 'white', {renderer: 'canvas'});\n",
       "                var option_4926cabf193b4fc0b9da58051018dff7 = {\n",
       "    \"backgroundColor\": \"papayawhip\",\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"lightcoral\",\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u6d88\\u8d39\\u8005\\u5206\\u5c42\",\n",
       "            \"data\": [\n",
       "                82775.6,\n",
       "                286060.03,\n",
       "                440910.22,\n",
       "                3673730.46\n",
       "            ],\n",
       "            \"barCategoryGap\": \"70%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6d88\\u8d39\\u8005\\u5206\\u5c42\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u6d88\\u8d39\\u8005\\u5206\\u5c42\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"top\": \"bottom\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u6d41\\u5931\\u5ba2\\u6237\",\n",
       "                \"\\u65b0\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u633d\\u7559\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u4ef7\\u503c\\u5ba2\\u6237\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{value}\"\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u4e0d\\u540c\\u5206\\u5c42\\u6d88\\u8d39\\u80052010\\u5e74\\u6d88\\u8d39\\u603b\\u989d\",\n",
       "            \"left\": \"center\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"lightcoral\"\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_4926cabf193b4fc0b9da58051018dff7.setOption(option_4926cabf193b4fc0b9da58051018dff7);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x12bc9430>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "consumer_r = film_da.groupby('客户编号')[\"销售额\"].agg([('消费总额',sum)])\n",
    "new_rfm = rfm_model.join(consumer_r)\n",
    "filter_list = ['流失客户','新客户','重要挽留客户','重要价值客户']\n",
    "new_rfm = new_rfm[new_rfm['Label of Customer'].astype('<U').isin(filter_list)]\n",
    "new_rfm['Customer'] = new_rfm['Label of Customer'].astype('<U')\n",
    "tmp = new_rfm.groupby(by='Customer',as_index=False)[\"消费总额\"].sum()\n",
    "tmp=tmp.sort_values(by=\"消费总额\",ascending=True)\n",
    "bar = (Bar(init_opts=opts.InitOpts(theme='white',bg_color='papayawhip'))\n",
    "       .add_xaxis(np.array(tmp[\"Customer\"]).tolist())\n",
    "       .add_yaxis('消费者分层',np.array(tmp[\"消费总额\"]).round(2).tolist(),color='lightcoral', category_gap='70%')\n",
    "       .set_global_opts(title_opts=opts.TitleOpts(title='不同分层消费者2010年消费总额',pos_left='center',\n",
    "                         title_textstyle_opts=opts.TextStyleOpts(color='lightcoral')),\n",
    "                        legend_opts=opts.LegendOpts(pos_top='bottom'),\n",
    "#                         toolbox_opts=opts.ToolboxOpts(is_show=True),\n",
    "                        yaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(formatter='{value}')))\n",
    ")\n",
    "bar.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 圣诞节前后被成功购买数量最多的前十个产品"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# 圣诞节前后的购物习惯\n",
    "#2010年12月14到2010年12月31的购买数据（商品销售最多）\n",
    "# 防止修改data4对film_date造成修改，使用copy对数据做一份拷贝\n",
    "data4 = film_date.dropna(how='all').copy()\n",
    "data4['订单日期和时间']=data4['订单日期和时间'].astype(np.str)\n",
    "shop_Christmas=data4[data4['订单日期和时间']>='2010-12-14']\n",
    "shop_Christmas=shop_Christmas[shop_Christmas['订单日期和时间']<='2010-12-31']\n",
    "# shop_Christmas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>产品描述</th>\n",
       "      <th>产品数量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>GROW A FLYTRAP OR SUNFLOWER IN TIN</td>\n",
       "      <td>2592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>HAND WARMER BABUSHKA DESIGN</td>\n",
       "      <td>2047</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>PACK OF 72 RETROSPOT CAKE CASES</td>\n",
       "      <td>1856</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>PACK OF 12 LONDON TISSUES</td>\n",
       "      <td>1617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>72 SWEETHEART FAIRY CAKE CASES</td>\n",
       "      <td>1114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>SMALL POPCORN HOLDER</td>\n",
       "      <td>1030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>PACK OF 60 PINK PAISLEY CAKE CASES</td>\n",
       "      <td>1015</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>WORLD WAR 2 GLIDERS ASSTD DESIGNS</td>\n",
       "      <td>1011</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>60 TEATIME FAIRY CAKE CASES</td>\n",
       "      <td>983</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>RED TOADSTOOL LED NIGHT LIGHT</td>\n",
       "      <td>956</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                 产品描述  产品数量\n",
       "0  GROW A FLYTRAP OR SUNFLOWER IN TIN  2592\n",
       "1         HAND WARMER BABUSHKA DESIGN  2047\n",
       "2     PACK OF 72 RETROSPOT CAKE CASES  1856\n",
       "3          PACK OF 12 LONDON TISSUES   1617\n",
       "4      72 SWEETHEART FAIRY CAKE CASES  1114\n",
       "5                SMALL POPCORN HOLDER  1030\n",
       "6  PACK OF 60 PINK PAISLEY CAKE CASES  1015\n",
       "7   WORLD WAR 2 GLIDERS ASSTD DESIGNS  1011\n",
       "8         60 TEATIME FAIRY CAKE CASES   983\n",
       "9       RED TOADSTOOL LED NIGHT LIGHT   956"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#圣诞节前后被成功购买数量最多的前十个产品\n",
    "shop_Christmas_sales=shop_Christmas.groupby(shop_Christmas[\"产品描述\"],as_index=False)[\"产品数量\"].sum()\n",
    "shop_Christmas_sales=shop_Christmas_sales.sort_values(by=\"产品数量\",ascending=False)\n",
    "shop_Christmas_sales=shop_Christmas_sales.head(10).reset_index().drop(\"index\",axis=1)\n",
    "shop_Christmas_sales"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"b34cfde946cb44f799ff9c36f50751c8\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_b34cfde946cb44f799ff9c36f50751c8 = echarts.init(\n",
       "                    document.getElementById('b34cfde946cb44f799ff9c36f50751c8'), 'white', {renderer: 'canvas'});\n",
       "                var option_b34cfde946cb44f799ff9c36f50751c8 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"GROW A FLYTRAP OR SUNFLOWER IN TIN\",\n",
       "                    \"value\": 2592\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"HAND WARMER BABUSHKA DESIGN\",\n",
       "                    \"value\": 2047\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"PACK OF 72 RETROSPOT CAKE CASES\",\n",
       "                    \"value\": 1856\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"PACK OF 12 LONDON TISSUES \",\n",
       "                    \"value\": 1617\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"72 SWEETHEART FAIRY CAKE CASES\",\n",
       "                    \"value\": 1114\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"SMALL POPCORN HOLDER\",\n",
       "                    \"value\": 1030\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"PACK OF 60 PINK PAISLEY CAKE CASES\",\n",
       "                    \"value\": 1015\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"WORLD WAR 2 GLIDERS ASSTD DESIGNS\",\n",
       "                    \"value\": 1011\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"60 TEATIME FAIRY CAKE CASES\",\n",
       "                    \"value\": 983\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"RED TOADSTOOL LED NIGHT LIGHT\",\n",
       "                    \"value\": 956\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"30%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"65%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"radius\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"GROW A FLYTRAP OR SUNFLOWER IN TIN\",\n",
       "                \"HAND WARMER BABUSHKA DESIGN\",\n",
       "                \"PACK OF 72 RETROSPOT CAKE CASES\",\n",
       "                \"PACK OF 12 LONDON TISSUES \",\n",
       "                \"72 SWEETHEART FAIRY CAKE CASES\",\n",
       "                \"SMALL POPCORN HOLDER\",\n",
       "                \"PACK OF 60 PINK PAISLEY CAKE CASES\",\n",
       "                \"WORLD WAR 2 GLIDERS ASSTD DESIGNS\",\n",
       "                \"60 TEATIME FAIRY CAKE CASES\",\n",
       "                \"RED TOADSTOOL LED NIGHT LIGHT\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"2%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"2010\\u5e74\\u5723\\u8bde\\u8282\\u524d\\u540e\\u88ab\\u6210\\u529f\\u8d2d\\u4e70\\u6570\\u91cf\\u6700\\u591a\\u7684\\u524d\\u5341\\u4e2a\\u4ea7\\u54c1\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_b34cfde946cb44f799ff9c36f50751c8.setOption(option_b34cfde946cb44f799ff9c36f50751c8);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x15a74ed0>"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 玫瑰图--圣诞节前后被成功购买数量最多的前十个产品\n",
    "pie=Pie().add(\n",
    "            \"\",\n",
    "            shop_Christmas_sales.values.tolist(),\n",
    "            radius=[\"30%\", \"75%\"],\n",
    "            center=[\"65%\", \"50%\"],\n",
    "            rosetype=\"radius\",\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "        ).set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"2010年圣诞节前后被成功购买数量最多的前十个产品\"),\n",
    "            legend_opts=opts.LegendOpts(\n",
    "                orient=\"vertical\", pos_top=\"15%\", pos_left=\"2%\"\n",
    "            )\n",
    "        ).set_series_opts(label_opts=opts.LabelOpts(formatter='{d}%'))\n",
    "pie.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 从玫瑰图中可以清楚的看出来，在圣诞节期间，热销的商品是GROW A FLYTRAP OR SUNFLOWER IN TIN，购买量达到了2592件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>产品描述</th>\n",
       "      <th>产品数量</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>GOLD MINI TAPE MEASURE</td>\n",
       "      <td>300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SMALLFOLKART BAUBLE CHRISTMAS DEC</td>\n",
       "      <td>96</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>CACTI T-LIGHT CANDLES</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>HYACINTH BULB T-LIGHT CANDLES</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>REGENCY CAKESTAND 3 TIER</td>\n",
       "      <td>71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>SILVER HANGING T-LIGHT HOLDER</td>\n",
       "      <td>65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>ASSTD DESIGN 3D PAPER STICKERS</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>VICTORIAN GLASS HANGING T-LIGHT</td>\n",
       "      <td>51</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>ANGEL DECORATION STARS ON DRESS</td>\n",
       "      <td>48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>COOK WITH WINE METAL SIGN</td>\n",
       "      <td>48</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                产品描述  产品数量\n",
       "0            GOLD MINI TAPE MEASURE    300\n",
       "1  SMALLFOLKART BAUBLE CHRISTMAS DEC    96\n",
       "2              CACTI T-LIGHT CANDLES    80\n",
       "3      HYACINTH BULB T-LIGHT CANDLES    80\n",
       "4           REGENCY CAKESTAND 3 TIER    71\n",
       "5      SILVER HANGING T-LIGHT HOLDER    65\n",
       "6     ASSTD DESIGN 3D PAPER STICKERS    60\n",
       "7    VICTORIAN GLASS HANGING T-LIGHT    51\n",
       "8    ANGEL DECORATION STARS ON DRESS    48\n",
       "9         COOK WITH WINE METAL SIGN     48"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 圣诞节前后被退货数量最多的前十个产品\n",
    "shop_Christmas_down=shop_Christmas[shop_Christmas[\"产品数量\"]<0]\n",
    "shop_Christmas_down=shop_Christmas_down.groupby(shop_Christmas_down[\"产品描述\"],as_index=False)[\"产品数量\"].sum()\n",
    "shop_Christmas_down=shop_Christmas_down.sort_values(by=\"产品数量\",ascending=True)\n",
    "shop_Christmas_down=shop_Christmas_down.head(10).reset_index().drop(\"index\",axis=1)\n",
    "shop_Christmas_down[\"产品数量\"]=shop_Christmas_down[\"产品数量\"].abs()\n",
    "shop_Christmas_down"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'chalk':'https://assets.pyecharts.org/assets/themes/chalk'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"8f537258dd9d414998ba157a8dd187ea\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'chalk'], function(echarts) {\n",
       "                var chart_8f537258dd9d414998ba157a8dd187ea = echarts.init(\n",
       "                    document.getElementById('8f537258dd9d414998ba157a8dd187ea'), 'chalk', {renderer: 'canvas'});\n",
       "                var option_8f537258dd9d414998ba157a8dd187ea = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"GOLD MINI TAPE MEASURE \",\n",
       "                    \"value\": 300\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"SMALLFOLKART BAUBLE CHRISTMAS DEC\",\n",
       "                    \"value\": 96\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"CACTI T-LIGHT CANDLES\",\n",
       "                    \"value\": 80\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"HYACINTH BULB T-LIGHT CANDLES\",\n",
       "                    \"value\": 80\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"REGENCY CAKESTAND 3 TIER\",\n",
       "                    \"value\": 71\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"SILVER HANGING T-LIGHT HOLDER\",\n",
       "                    \"value\": 65\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"ASSTD DESIGN 3D PAPER STICKERS\",\n",
       "                    \"value\": 60\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"VICTORIAN GLASS HANGING T-LIGHT\",\n",
       "                    \"value\": 51\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"ANGEL DECORATION STARS ON DRESS\",\n",
       "                    \"value\": 48\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"COOK WITH WINE METAL SIGN \",\n",
       "                    \"value\": 48\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"60%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"GOLD MINI TAPE MEASURE \",\n",
       "                \"SMALLFOLKART BAUBLE CHRISTMAS DEC\",\n",
       "                \"CACTI T-LIGHT CANDLES\",\n",
       "                \"HYACINTH BULB T-LIGHT CANDLES\",\n",
       "                \"REGENCY CAKESTAND 3 TIER\",\n",
       "                \"SILVER HANGING T-LIGHT HOLDER\",\n",
       "                \"ASSTD DESIGN 3D PAPER STICKERS\",\n",
       "                \"VICTORIAN GLASS HANGING T-LIGHT\",\n",
       "                \"ANGEL DECORATION STARS ON DRESS\",\n",
       "                \"COOK WITH WINE METAL SIGN \"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"2%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5723\\u8bde\\u8282\\u524d\\u540e\\u88ab\\u9000\\u8d27\\u6570\\u91cf\\u6700\\u591a\\u7684\\u524d\\u5341\\u4e2a\\u4ea7\\u54c1\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_8f537258dd9d414998ba157a8dd187ea.setOption(option_8f537258dd9d414998ba157a8dd187ea);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x12f642f0>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#饼图 \n",
    "pie=Pie(init_opts=opts.InitOpts(theme=ThemeType.CHALK)).add(\"\",shop_Christmas_down.values.tolist(),center=[\"60%\", \"50%\"])\n",
    "pie.set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "pie.set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"圣诞节前后被退货数量最多的前十个产品\"),\n",
    "            legend_opts=opts.LegendOpts(\n",
    "                orient=\"vertical\", pos_top=\"15%\", pos_left=\"2%\"\n",
    "            ),\n",
    "        ).set_series_opts(label_opts=opts.LabelOpts(formatter='{d}%'))\n",
    "pie.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 在圣诞节期间被退货最多的商品是GOLD MINI TAPE MEASURE，总数达到了300件"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 6.交易额前十的国家成功购买率的情况分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>国家的名称</th>\n",
       "      <th>产品数量</th>\n",
       "      <th>退货商品</th>\n",
       "      <th>成功购买率</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>United Kingdom</td>\n",
       "      <td>3907657</td>\n",
       "      <td>246161</td>\n",
       "      <td>94.073862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Netherlands</td>\n",
       "      <td>193375</td>\n",
       "      <td>3894</td>\n",
       "      <td>98.026046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>EIRE</td>\n",
       "      <td>131470</td>\n",
       "      <td>1741</td>\n",
       "      <td>98.693051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Germany</td>\n",
       "      <td>111640</td>\n",
       "      <td>1533</td>\n",
       "      <td>98.645437</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>France</td>\n",
       "      <td>106432</td>\n",
       "      <td>1345</td>\n",
       "      <td>98.752053</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Australia</td>\n",
       "      <td>82095</td>\n",
       "      <td>795</td>\n",
       "      <td>99.040898</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>35316</td>\n",
       "      <td>564</td>\n",
       "      <td>98.428094</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>27847</td>\n",
       "      <td>554</td>\n",
       "      <td>98.049364</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Japan</td>\n",
       "      <td>25356</td>\n",
       "      <td>312</td>\n",
       "      <td>98.784479</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Spain</td>\n",
       "      <td>23112</td>\n",
       "      <td>293</td>\n",
       "      <td>98.748131</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            国家的名称     产品数量    退货商品      成功购买率\n",
       "0  United Kingdom  3907657  246161  94.073862\n",
       "1     Netherlands   193375    3894  98.026046\n",
       "2            EIRE   131470    1741  98.693051\n",
       "3         Germany   111640    1533  98.645437\n",
       "4          France   106432    1345  98.752053\n",
       "5       Australia    82095     795  99.040898\n",
       "6          Sweden    35316     564  98.428094\n",
       "7     Switzerland    27847     554  98.049364\n",
       "8           Japan    25356     312  98.784479\n",
       "9           Spain    23112     293  98.748131"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 求出购买数前十国家的成功购买率\n",
    "film_da\n",
    "success_sales=film_da.groupby(\"国家的名称\",as_index=False)[\"产品数量\"].sum()\n",
    "success_sales.sort_values(by=\"产品数量\",ascending=False,inplace=True)\n",
    "success_sales=success_sales.reset_index().drop(\"index\",axis=1)\n",
    "\n",
    "fail_sales=film_xiao.groupby(\"国家的名称\",as_index=False)[\"产品数量\"].sum()\n",
    "fail_sales.sort_values(by=\"产品数量\",ascending=True,inplace=True)\n",
    "fail_sales=fail_sales.reset_index().drop(\"index\",axis=1)\n",
    "success_sales[\"退货商品\"]=fail_sales[\"产品数量\"]\n",
    "success_sales=success_sales.head(10)\n",
    "success_sales[\"退货商品\"]=success_sales[\"退货商品\"].astype(np.int64).abs()\n",
    "success_sales[\"成功购买率\"]=success_sales[\"产品数量\"]/(success_sales[\"退货商品\"]+success_sales[\"产品数量\"])*100\n",
    "success_sales"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"0a8e10c3064e4aa198701bfe16abb8b6\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_0a8e10c3064e4aa198701bfe16abb8b6 = echarts.init(\n",
       "                    document.getElementById('0a8e10c3064e4aa198701bfe16abb8b6'), 'white', {renderer: 'canvas'});\n",
       "                var option_0a8e10c3064e4aa198701bfe16abb8b6 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u9500\\u552e\\u91cf\\u524d\\u5341\\u56fd\\u5bb6\\u7684\\u6210\\u529f\\u8d2d\\u4e70\\u7387\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"United Kingdom\",\n",
       "                    94.0739\n",
       "                ],\n",
       "                [\n",
       "                    \"Netherlands\",\n",
       "                    98.026\n",
       "                ],\n",
       "                [\n",
       "                    \"EIRE\",\n",
       "                    98.6931\n",
       "                ],\n",
       "                [\n",
       "                    \"Germany\",\n",
       "                    98.6454\n",
       "                ],\n",
       "                [\n",
       "                    \"France\",\n",
       "                    98.7521\n",
       "                ],\n",
       "                [\n",
       "                    \"Australia\",\n",
       "                    99.0409\n",
       "                ],\n",
       "                [\n",
       "                    \"Sweden\",\n",
       "                    98.4281\n",
       "                ],\n",
       "                [\n",
       "                    \"Switzerland\",\n",
       "                    98.0494\n",
       "                ],\n",
       "                [\n",
       "                    \"Japan\",\n",
       "                    98.7845\n",
       "                ],\n",
       "                [\n",
       "                    \"Spain\",\n",
       "                    98.7481\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 20,\n",
       "                \"fontStyle\": \"italic\"\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5927\\u503c\",\n",
       "                        \"type\": \"max\",\n",
       "                        \"symbolSize\": [\n",
       "                            90,\n",
       "                            70\n",
       "                        ]\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5c0f\\u503c\",\n",
       "                        \"type\": \"min\",\n",
       "                        \"symbolSize\": [\n",
       "                            90,\n",
       "                            70\n",
       "                        ]\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u5e73\\u5747\\u503c\",\n",
       "                        \"type\": \"average\",\n",
       "                        \"symbolSize\": [\n",
       "                            90,\n",
       "                            70\n",
       "                        ]\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0,\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u9500\\u552e\\u91cf\\u524d\\u5341\\u56fd\\u5bb6\\u7684\\u6210\\u529f\\u8d2d\\u4e70\\u7387\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u9500\\u552e\\u91cf\\u524d\\u5341\\u56fd\\u5bb6\\u7684\\u6210\\u529f\\u8d2d\\u4e70\\u7387\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u56fd\\u5bb6\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"rotate\": 30,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"United Kingdom\",\n",
       "                \"Netherlands\",\n",
       "                \"EIRE\",\n",
       "                \"Germany\",\n",
       "                \"France\",\n",
       "                \"Australia\",\n",
       "                \"Sweden\",\n",
       "                \"Switzerland\",\n",
       "                \"Japan\",\n",
       "                \"Spain\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u6210\\u529f\\u8d2d\\u4e70\\u7387(%)\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"min\": 94,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u9500\\u552e\\u91cf\\u524d\\u5341\\u56fd\\u5bb6\\u7684\\u6210\\u529f\\u8d2d\\u4e70\\u7387\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_0a8e10c3064e4aa198701bfe16abb8b6.setOption(option_0a8e10c3064e4aa198701bfe16abb8b6);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x12bc9110>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#条形图\n",
    "line = Line()\n",
    "line.add_xaxis(np.array(success_sales[\"国家的名称\"]).tolist())\n",
    "line.add_yaxis(\"销售量前十国家的成功购买率\",np.array(success_sales[\"成功购买率\"]).round(4).tolist())\n",
    "# line.add_yaxis(\"销售量前十国家的退货商品\",np.array(success_sales[\"退货商品\"]).round(4).tolist())\n",
    "# line.add_yaxis(\"销售量前十国家的产品数量\",np.array(success_sales[\"产品数量\"]).round(4).tolist())\n",
    "line.set_global_opts(title_opts=opts.TitleOpts(title=\"销售量前十国家的成功购买率\"),\n",
    "#                     toolbox_opts=opts.ToolboxOpts(),\n",
    "#                     datazoom_opts=opts.DataZoomOpts(is_show=True),\n",
    "                   yaxis_opts=opts.AxisOpts(\n",
    "                    name='成功购买率(%)',min_=94\n",
    "                   ),\n",
    "                    xaxis_opts=opts.AxisOpts(\n",
    "                    name='国家',axislabel_opts=opts.LabelOpts(rotate=30))\n",
    "                     \n",
    "                   )\n",
    "line.set_series_opts(label_opts=opts.LabelOpts(font_size=20,font_style=\"italic\"),\n",
    "            markpoint_opts=opts.MarkPointOpts(\n",
    "                data=[\n",
    "                    opts.MarkPointItem(type_=\"max\", name=\"最大值\",symbol_size=[90, 70]),\n",
    "                    opts.MarkPointItem(type_=\"min\", name=\"最小值\",symbol_size=[90, 70]),\n",
    "                    opts.MarkPointItem(type_=\"average\", name=\"平均值\",symbol_size=[90, 70]),\n",
    "                    \n",
    "                ]\n",
    "            ))\n",
    "line.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 从折线图中可以看出来，"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pyecharts.charts.composite_charts.tab.Tab at 0x13201310>"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#图汇总\n",
    "def bar_one() -> Bar:\n",
    "    c = (\n",
    "           Bar(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))\n",
    "            .add_xaxis(np.array(list[\"国家的名称\"]).tolist())\n",
    "            .add_yaxis(\"购买商品数排名前十的国家\",np.array(list[\"产品数量\"]).tolist())\n",
    "    #设置全局配置\n",
    "            .set_global_opts(title_opts=opts.TitleOpts(title=\"购买商品数排名前十的国家\"),\n",
    "                        toolbox_opts=opts.ToolboxOpts(),\n",
    "                        datazoom_opts=opts.DataZoomOpts(is_show=True),\n",
    "                       yaxis_opts=opts.AxisOpts(\n",
    "                        name='产品数量'),\n",
    "                        xaxis_opts=opts.AxisOpts(\n",
    "                        name='国家的名称',axislabel_opts=opts.LabelOpts(rotate=15))\n",
    "                       )\n",
    "    #设置系列配置label_opts=opts.LabelOpts(font_size=20,font_style=\"italic\"),\n",
    "        .set_series_opts(label_opts=opts.LabelOpts(font_size=20,font_style=\"italic\"),\n",
    "                        markpoint_opts=opts.MarkPointOpts(\n",
    "                    data=[\n",
    "                        opts.MarkPointItem(type_=\"max\", name=\"最大值\",symbol_size=[90, 70]),\n",
    "                        opts.MarkPointItem(type_=\"min\", name=\"最小值\",symbol_size=[90, 70]),\n",
    "                        opts.MarkPointItem(type_=\"average\", name=\"平均值\",symbol_size=[90, 70]),\n",
    "\n",
    "                    ]\n",
    "                ))\n",
    "    )\n",
    "    return c\n",
    "\n",
    "\n",
    "\n",
    "def bar_two()->Bar:\n",
    "    c=(\n",
    "        Bar(init_opts=opts.InitOpts(theme=ThemeType.ESSOS))\n",
    "    .add_xaxis(np.array(list_sales[\"国家的名称\"]).tolist())\n",
    "    .add_yaxis(\"销售额排名前十的国家\",np.array(list_sales[\"销售额\"]).round(2).tolist())\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"交易额排名前十的国家\"),\n",
    "                        toolbox_opts=opts.ToolboxOpts(),\n",
    "                        datazoom_opts=opts.DataZoomOpts(is_show=True),\n",
    "                       yaxis_opts=opts.AxisOpts(\n",
    "                        name='销售额(英镑)'),\n",
    "                        xaxis_opts=opts.AxisOpts(\n",
    "                        name='国家的名称',axislabel_opts=opts.LabelOpts(rotate=15))\n",
    "\n",
    "                       )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(font_size=20,font_style=\"italic\"),\n",
    "                markline_opts=opts.MarkLineOpts(\n",
    "                    data=[\n",
    "                        opts.MarkLineItem(type_=\"max\", name=\"最大值\"),\n",
    "                        opts.MarkLineItem(type_=\"min\", name=\"最小值\"),\n",
    "                        opts.MarkLineItem(type_=\"average\", name=\"平均值\"),\n",
    "                    ]\n",
    "                ))\n",
    "    )\n",
    "    return c\n",
    "    \n",
    "def bar_three()->Line:\n",
    "    c=(\n",
    "        Line(init_opts=opts.InitOpts(theme=ThemeType.DARK))\n",
    "        .add_xaxis(np.array(list_month_sales[\"month\"]).tolist())\n",
    "        .add_yaxis(\"2010年12月到2011年12月的产品数量\",np.array(list_month_sales[\"产品数量\"]).round(2).tolist())\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"2010年12月到2011年12月的产品数量\"),\n",
    "#                     toolbox_opts=opts.ToolboxOpts(),\n",
    "                    datazoom_opts=opts.DataZoomOpts(is_show=True),\n",
    "                   yaxis_opts=opts.AxisOpts(\n",
    "                    name='产品数量'),\n",
    "                    xaxis_opts=opts.AxisOpts(\n",
    "                    name='月份')\n",
    "                   )\n",
    "        .set_series_opts(label_opts=opts.LabelOpts(font_size=20,font_style=\"italic\"),\n",
    "                        markpoint_opts=opts.MarkPointOpts(\n",
    "                    data=[\n",
    "                        opts.MarkPointItem(type_=\"max\", name=\"最大值\",symbol_size=[90, 70]),\n",
    "                        opts.MarkPointItem(type_=\"min\", name=\"最小值\",symbol_size=[90, 70]),\n",
    "                        opts.MarkPointItem(type_=\"average\", name=\"平均值\",symbol_size=[90, 70]),\n",
    "\n",
    "                    ]\n",
    "                ))\n",
    "    )\n",
    "    return c\n",
    "\n",
    "\n",
    "def pie_five_1() -> Pie:\n",
    "    c = (\n",
    "    Pie()\n",
    "    .add('',tmp.values.tolist(),\n",
    "     radius=['30%','75%'],\n",
    "     center=[\"60%\", \"50%\"],\n",
    "     rosetype='radius',\n",
    "     label_opts=opts.LabelOpts(is_show=True))\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title='消费者分层结构',pos_left='center'),\n",
    "#                      toolbox_opts=opts.ToolboxOpts(is_show=True),\n",
    "                     legend_opts=opts.LegendOpts(orient='vertical',pos_left='0%',pos_top='30%'))\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter='{b}:{d}%'))\n",
    "\n",
    "    )\n",
    "    return c\n",
    "\n",
    "\n",
    "\n",
    "def bar_five_2() -> Bar:\n",
    "    c = (\n",
    "        Bar(init_opts=opts.InitOpts(theme='white',bg_color='papayawhip'))\n",
    "       .add_xaxis(np.array(tmp[\"Customer\"]).tolist())\n",
    "       .add_yaxis('消费者分层',np.array(tmp[\"消费总额\"]).round(2).tolist(),color='lightcoral', category_gap='70%')\n",
    "       .set_global_opts(title_opts=opts.TitleOpts(title='不同分层消费者2010年消费总额',pos_left='center',\n",
    "                         title_textstyle_opts=opts.TextStyleOpts(color='lightcoral')),\n",
    "                        legend_opts=opts.LegendOpts(pos_top='bottom'),\n",
    "#                         toolbox_opts=opts.ToolboxOpts(is_show=True),\n",
    "                        yaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(formatter='{value}')))\n",
    "    )\n",
    "    return c\n",
    "\n",
    "\n",
    "\n",
    "    \n",
    "def line_five_3() -> Line:\n",
    "    c = (\n",
    "        Pie().add(\n",
    "            \"\",\n",
    "            shop_Christmas_sales.values.tolist(),\n",
    "            radius=[\"30%\", \"75%\"],\n",
    "            center=[\"60%\", \"50%\"],\n",
    "            rosetype=\"radius\",\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "        ).set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"2010年圣诞节前后被成功购买数量最多的前十个产品\"),\n",
    "            legend_opts=opts.LegendOpts(\n",
    "                orient=\"vertical\", pos_top=\"15%\", pos_left=\"2%\"\n",
    "            )\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "\n",
    "\n",
    "def pie_five_4() -> Pie:\n",
    "    c = (\n",
    "        Pie(init_opts=opts.InitOpts(theme=ThemeType.CHALK)).add(\"\",shop_Christmas_down.values.tolist(),center=[\"60%\", \"50%\"],)\n",
    "        .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"圣诞节前后被退货数量最多的前十个产品\"),\n",
    "            legend_opts=opts.LegendOpts(\n",
    "                orient=\"vertical\", pos_top=\"15%\", pos_left=\"2%\"\n",
    "            ),\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "\n",
    "tab = Tab()\n",
    "tab.add(bar_one(), \"bar_one\")\n",
    "tab.add(bar_two(), \"bar_two\")\n",
    "tab.add(bar_three(), \"bar_three\")\n",
    "tab.add(pie_five_1(), \"pie_five_1\")\n",
    "tab.add(bar_five_2(), \"bar_five_2\")\n",
    "tab.add(line_five_3(), \"line_five_3\")\n",
    "tab.add(pie_five_4(), \"pie_five_4\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'purple-passion':'https://assets.pyecharts.org/assets/themes/purple-passion', 'essos':'https://assets.pyecharts.org/assets/themes/essos', 'chalk':'https://assets.pyecharts.org/assets/themes/chalk'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "    <style>\n",
       "        .tab {\n",
       "            overflow: hidden;\n",
       "            border: 1px solid #ccc;\n",
       "            background-color: #f1f1f1;\n",
       "        }\n",
       "\n",
       "        .tab button {\n",
       "            background-color: inherit;\n",
       "            float: left;\n",
       "            border: none;\n",
       "            outline: none;\n",
       "            cursor: pointer;\n",
       "            padding: 12px 16px;\n",
       "            transition: 0.3s;\n",
       "        }\n",
       "\n",
       "        .tab button:hover {\n",
       "            background-color: #ddd;\n",
       "        }\n",
       "\n",
       "        .tab button.active {\n",
       "            background-color: #ccc;\n",
       "        }\n",
       "\n",
       "        .chart-container {\n",
       "            display: none;\n",
       "            padding: 6px 12px;\n",
       "            border-top: none;\n",
       "        }\n",
       "    </style>\n",
       "<div class=\"tab\">\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '2019dc4b1c3b417382f5656b8268d220')\">bar_one</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, 'bdf8fc9f8e17441da0cb451b93b426fb')\">bar_two</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, 'cee9505dcb46488ca4dba4159a879362')\">bar_three</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, 'f110697a84dd4d74bc60732eb25626c7')\">pie_five_1</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '373bf5a236b54485bef0b60c124a6770')\">bar_five_2</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, '59d641810b544e2bac3341016167226a')\">line_five_3</button>\n",
       "            <button class=\"tablinks\" onclick=\"showChart(event, 'a351912193114272888fc43b0d235750')\">pie_five_4</button>\n",
       "    </div>\n",
       "\n",
       "        <div id=\"2019dc4b1c3b417382f5656b8268d220\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"bdf8fc9f8e17441da0cb451b93b426fb\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"cee9505dcb46488ca4dba4159a879362\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"f110697a84dd4d74bc60732eb25626c7\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"373bf5a236b54485bef0b60c124a6770\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"59d641810b544e2bac3341016167226a\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "        <div id=\"a351912193114272888fc43b0d235750\" class=\"chart-container\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'purple-passion', 'essos', 'chalk'], function(echarts) {\n",
       "                var chart_2019dc4b1c3b417382f5656b8268d220 = echarts.init(\n",
       "                    document.getElementById('2019dc4b1c3b417382f5656b8268d220'), 'purple-passion', {renderer: 'canvas'});\n",
       "                var option_2019dc4b1c3b417382f5656b8268d220 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u8d2d\\u4e70\\u5546\\u54c1\\u6570\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\",\n",
       "            \"data\": [\n",
       "                3907657,\n",
       "                193375,\n",
       "                131470,\n",
       "                111640,\n",
       "                106432,\n",
       "                82095,\n",
       "                35316,\n",
       "                27847,\n",
       "                25356,\n",
       "                23112\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 20,\n",
       "                \"fontStyle\": \"italic\"\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5927\\u503c\",\n",
       "                        \"type\": \"max\",\n",
       "                        \"symbolSize\": [\n",
       "                            90,\n",
       "                            70\n",
       "                        ]\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5c0f\\u503c\",\n",
       "                        \"type\": \"min\",\n",
       "                        \"symbolSize\": [\n",
       "                            90,\n",
       "                            70\n",
       "                        ]\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u5e73\\u5747\\u503c\",\n",
       "                        \"type\": \"average\",\n",
       "                        \"symbolSize\": [\n",
       "                            90,\n",
       "                            70\n",
       "                        ]\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u8d2d\\u4e70\\u5546\\u54c1\\u6570\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u8d2d\\u4e70\\u5546\\u54c1\\u6570\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u56fd\\u5bb6\\u7684\\u540d\\u79f0\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"rotate\": 15,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"United Kingdom\",\n",
       "                \"Netherlands\",\n",
       "                \"EIRE\",\n",
       "                \"Germany\",\n",
       "                \"France\",\n",
       "                \"Australia\",\n",
       "                \"Sweden\",\n",
       "                \"Switzerland\",\n",
       "                \"Japan\",\n",
       "                \"Spain\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u4ea7\\u54c1\\u6570\\u91cf\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u8d2d\\u4e70\\u5546\\u54c1\\u6570\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"80%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"type\": \"png\",\n",
       "                \"backgroundColor\": \"auto\",\n",
       "                \"connectedBackgroundColor\": \"#fff\",\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n",
       "                \"pixelRatio\": 1\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u8fd8\\u539f\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                \"readOnly\": false,\n",
       "                \"lang\": [\n",
       "                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                    \"\\u5173\\u95ed\",\n",
       "                    \"\\u5237\\u65b0\"\n",
       "                ],\n",
       "                \"backgroundColor\": \"#fff\",\n",
       "                \"textareaColor\": \"#fff\",\n",
       "                \"textareaBorderColor\": \"#333\",\n",
       "                \"textColor\": \"#000\",\n",
       "                \"buttonColor\": \"#c23531\",\n",
       "                \"buttonTextColor\": \"#fff\"\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n",
       "                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"magicType\": {\n",
       "                \"show\": true,\n",
       "                \"type\": [\n",
       "                    \"line\",\n",
       "                    \"bar\",\n",
       "                    \"stack\",\n",
       "                    \"tiled\"\n",
       "                ],\n",
       "                \"title\": {\n",
       "                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n",
       "                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n",
       "                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n",
       "                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"brush\": {\n",
       "                \"icon\": {},\n",
       "                \"title\": {\n",
       "                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n",
       "                    \"polygon\": \"\\u5708\\u9009\",\n",
       "                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n",
       "                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n",
       "                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n",
       "                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false\n",
       "    }\n",
       "};\n",
       "                chart_2019dc4b1c3b417382f5656b8268d220.setOption(option_2019dc4b1c3b417382f5656b8268d220);\n",
       "                var chart_bdf8fc9f8e17441da0cb451b93b426fb = echarts.init(\n",
       "                    document.getElementById('bdf8fc9f8e17441da0cb451b93b426fb'), 'essos', {renderer: 'canvas'});\n",
       "                var option_bdf8fc9f8e17441da0cb451b93b426fb = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u9500\\u552e\\u989d\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\",\n",
       "            \"data\": [\n",
       "                6623368.43,\n",
       "                269330.18,\n",
       "                242698.34,\n",
       "                190201.94,\n",
       "                173532.12,\n",
       "                134070.62,\n",
       "                48109.33,\n",
       "                43046.19,\n",
       "                35975.17,\n",
       "                35128.05\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 20,\n",
       "                \"fontStyle\": \"italic\"\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5927\\u503c\",\n",
       "                        \"type\": \"max\"\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5c0f\\u503c\",\n",
       "                        \"type\": \"min\"\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u5e73\\u5747\\u503c\",\n",
       "                        \"type\": \"average\"\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u9500\\u552e\\u989d\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u9500\\u552e\\u989d\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u56fd\\u5bb6\\u7684\\u540d\\u79f0\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"rotate\": 15,\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"United Kingdom\",\n",
       "                \"Netherlands\",\n",
       "                \"EIRE\",\n",
       "                \"Germany\",\n",
       "                \"France\",\n",
       "                \"Australia\",\n",
       "                \"Switzerland\",\n",
       "                \"Spain\",\n",
       "                \"Japan\",\n",
       "                \"Sweden\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u9500\\u552e\\u989d(\\u82f1\\u9551)\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u4ea4\\u6613\\u989d\\u6392\\u540d\\u524d\\u5341\\u7684\\u56fd\\u5bb6\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": true,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"80%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"type\": \"png\",\n",
       "                \"backgroundColor\": \"auto\",\n",
       "                \"connectedBackgroundColor\": \"#fff\",\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n",
       "                \"pixelRatio\": 1\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u8fd8\\u539f\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                \"readOnly\": false,\n",
       "                \"lang\": [\n",
       "                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                    \"\\u5173\\u95ed\",\n",
       "                    \"\\u5237\\u65b0\"\n",
       "                ],\n",
       "                \"backgroundColor\": \"#fff\",\n",
       "                \"textareaColor\": \"#fff\",\n",
       "                \"textareaBorderColor\": \"#333\",\n",
       "                \"textColor\": \"#000\",\n",
       "                \"buttonColor\": \"#c23531\",\n",
       "                \"buttonTextColor\": \"#fff\"\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n",
       "                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"magicType\": {\n",
       "                \"show\": true,\n",
       "                \"type\": [\n",
       "                    \"line\",\n",
       "                    \"bar\",\n",
       "                    \"stack\",\n",
       "                    \"tiled\"\n",
       "                ],\n",
       "                \"title\": {\n",
       "                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n",
       "                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n",
       "                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n",
       "                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"brush\": {\n",
       "                \"icon\": {},\n",
       "                \"title\": {\n",
       "                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n",
       "                    \"polygon\": \"\\u5708\\u9009\",\n",
       "                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n",
       "                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n",
       "                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n",
       "                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    },\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false\n",
       "    }\n",
       "};\n",
       "                chart_bdf8fc9f8e17441da0cb451b93b426fb.setOption(option_bdf8fc9f8e17441da0cb451b93b426fb);\n",
       "                var chart_cee9505dcb46488ca4dba4159a879362 = echarts.init(\n",
       "                    document.getElementById('cee9505dcb46488ca4dba4159a879362'), 'dark', {renderer: 'canvas'});\n",
       "                var option_cee9505dcb46488ca4dba4159a879362 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"2010\\u5e7412\\u6708\\u52302011\\u5e7412\\u6708\\u7684\\u4ea7\\u54c1\\u6570\\u91cf\",\n",
       "            \"connectNulls\": false,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    1,\n",
       "                    238707\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    240684\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    312207\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    250371\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    338177\n",
       "                ],\n",
       "                [\n",
       "                    6,\n",
       "                    329235\n",
       "                ],\n",
       "                [\n",
       "                    7,\n",
       "                    332333\n",
       "                ],\n",
       "                [\n",
       "                    8,\n",
       "                    355492\n",
       "                ],\n",
       "                [\n",
       "                    9,\n",
       "                    501976\n",
       "                ],\n",
       "                [\n",
       "                    10,\n",
       "                    531816\n",
       "                ],\n",
       "                [\n",
       "                    11,\n",
       "                    620358\n",
       "                ],\n",
       "                [\n",
       "                    12,\n",
       "                    191572\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 20,\n",
       "                \"fontStyle\": \"italic\"\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5927\\u503c\",\n",
       "                        \"type\": \"max\",\n",
       "                        \"symbolSize\": [\n",
       "                            90,\n",
       "                            70\n",
       "                        ]\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u6700\\u5c0f\\u503c\",\n",
       "                        \"type\": \"min\",\n",
       "                        \"symbolSize\": [\n",
       "                            90,\n",
       "                            70\n",
       "                        ]\n",
       "                    },\n",
       "                    {\n",
       "                        \"name\": \"\\u5e73\\u5747\\u503c\",\n",
       "                        \"type\": \"average\",\n",
       "                        \"symbolSize\": [\n",
       "                            90,\n",
       "                            70\n",
       "                        ]\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0,\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"2010\\u5e7412\\u6708\\u52302011\\u5e7412\\u6708\\u7684\\u4ea7\\u54c1\\u6570\\u91cf\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"2010\\u5e7412\\u6708\\u52302011\\u5e7412\\u6708\\u7684\\u4ea7\\u54c1\\u6570\\u91cf\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u6708\\u4efd\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                1,\n",
       "                2,\n",
       "                3,\n",
       "                4,\n",
       "                5,\n",
       "                6,\n",
       "                7,\n",
       "                8,\n",
       "                9,\n",
       "                10,\n",
       "                11,\n",
       "                12\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"name\": \"\\u4ea7\\u54c1\\u6570\\u91cf\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"2010\\u5e7412\\u6708\\u52302011\\u5e7412\\u6708\\u7684\\u4ea7\\u54c1\\u6570\\u91cf\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false\n",
       "    }\n",
       "};\n",
       "                chart_cee9505dcb46488ca4dba4159a879362.setOption(option_cee9505dcb46488ca4dba4159a879362);\n",
       "                var chart_f110697a84dd4d74bc60732eb25626c7 = echarts.init(\n",
       "                    document.getElementById('f110697a84dd4d74bc60732eb25626c7'), 'white', {renderer: 'canvas'});\n",
       "                var option_f110697a84dd4d74bc60732eb25626c7 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u6d41\\u5931\\u5ba2\\u6237\",\n",
       "                    \"value\": 82775.59999999995\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u65b0\\u5ba2\\u6237\",\n",
       "                    \"value\": 286060.03000000026\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u8981\\u633d\\u7559\\u5ba2\\u6237\",\n",
       "                    \"value\": 440910.21999999974\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u8981\\u4ef7\\u503c\\u5ba2\\u6237\",\n",
       "                    \"value\": 3673730.4599999995\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"30%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"60%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"radius\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}:{d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6d41\\u5931\\u5ba2\\u6237\",\n",
       "                \"\\u65b0\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u633d\\u7559\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u4ef7\\u503c\\u5ba2\\u6237\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"0%\",\n",
       "            \"top\": \"30%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6d88\\u8d39\\u8005\\u5206\\u5c42\\u7ed3\\u6784\",\n",
       "            \"left\": \"center\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_f110697a84dd4d74bc60732eb25626c7.setOption(option_f110697a84dd4d74bc60732eb25626c7);\n",
       "                var chart_373bf5a236b54485bef0b60c124a6770 = echarts.init(\n",
       "                    document.getElementById('373bf5a236b54485bef0b60c124a6770'), 'white', {renderer: 'canvas'});\n",
       "                var option_373bf5a236b54485bef0b60c124a6770 = {\n",
       "    \"backgroundColor\": \"papayawhip\",\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"lightcoral\",\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u6d88\\u8d39\\u8005\\u5206\\u5c42\",\n",
       "            \"data\": [\n",
       "                82775.6,\n",
       "                286060.03,\n",
       "                440910.22,\n",
       "                3673730.46\n",
       "            ],\n",
       "            \"barCategoryGap\": \"70%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6d88\\u8d39\\u8005\\u5206\\u5c42\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u6d88\\u8d39\\u8005\\u5206\\u5c42\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"top\": \"bottom\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u6d41\\u5931\\u5ba2\\u6237\",\n",
       "                \"\\u65b0\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u633d\\u7559\\u5ba2\\u6237\",\n",
       "                \"\\u91cd\\u8981\\u4ef7\\u503c\\u5ba2\\u6237\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{value}\"\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u4e0d\\u540c\\u5206\\u5c42\\u6d88\\u8d39\\u80052010\\u5e74\\u6d88\\u8d39\\u603b\\u989d\",\n",
       "            \"left\": \"center\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"lightcoral\"\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_373bf5a236b54485bef0b60c124a6770.setOption(option_373bf5a236b54485bef0b60c124a6770);\n",
       "                var chart_59d641810b544e2bac3341016167226a = echarts.init(\n",
       "                    document.getElementById('59d641810b544e2bac3341016167226a'), 'white', {renderer: 'canvas'});\n",
       "                var option_59d641810b544e2bac3341016167226a = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"GROW A FLYTRAP OR SUNFLOWER IN TIN\",\n",
       "                    \"value\": 2592\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"HAND WARMER BABUSHKA DESIGN\",\n",
       "                    \"value\": 2047\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"PACK OF 72 RETROSPOT CAKE CASES\",\n",
       "                    \"value\": 1856\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"PACK OF 12 LONDON TISSUES \",\n",
       "                    \"value\": 1617\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"72 SWEETHEART FAIRY CAKE CASES\",\n",
       "                    \"value\": 1114\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"SMALL POPCORN HOLDER\",\n",
       "                    \"value\": 1030\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"PACK OF 60 PINK PAISLEY CAKE CASES\",\n",
       "                    \"value\": 1015\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"WORLD WAR 2 GLIDERS ASSTD DESIGNS\",\n",
       "                    \"value\": 1011\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"60 TEATIME FAIRY CAKE CASES\",\n",
       "                    \"value\": 983\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"RED TOADSTOOL LED NIGHT LIGHT\",\n",
       "                    \"value\": 956\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"30%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"60%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"radius\",\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"GROW A FLYTRAP OR SUNFLOWER IN TIN\",\n",
       "                \"HAND WARMER BABUSHKA DESIGN\",\n",
       "                \"PACK OF 72 RETROSPOT CAKE CASES\",\n",
       "                \"PACK OF 12 LONDON TISSUES \",\n",
       "                \"72 SWEETHEART FAIRY CAKE CASES\",\n",
       "                \"SMALL POPCORN HOLDER\",\n",
       "                \"PACK OF 60 PINK PAISLEY CAKE CASES\",\n",
       "                \"WORLD WAR 2 GLIDERS ASSTD DESIGNS\",\n",
       "                \"60 TEATIME FAIRY CAKE CASES\",\n",
       "                \"RED TOADSTOOL LED NIGHT LIGHT\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"2%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"2010\\u5e74\\u5723\\u8bde\\u8282\\u524d\\u540e\\u88ab\\u6210\\u529f\\u8d2d\\u4e70\\u6570\\u91cf\\u6700\\u591a\\u7684\\u524d\\u5341\\u4e2a\\u4ea7\\u54c1\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_59d641810b544e2bac3341016167226a.setOption(option_59d641810b544e2bac3341016167226a);\n",
       "                var chart_a351912193114272888fc43b0d235750 = echarts.init(\n",
       "                    document.getElementById('a351912193114272888fc43b0d235750'), 'chalk', {renderer: 'canvas'});\n",
       "                var option_a351912193114272888fc43b0d235750 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"GOLD MINI TAPE MEASURE \",\n",
       "                    \"value\": 300\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"SMALLFOLKART BAUBLE CHRISTMAS DEC\",\n",
       "                    \"value\": 96\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"CACTI T-LIGHT CANDLES\",\n",
       "                    \"value\": 80\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"HYACINTH BULB T-LIGHT CANDLES\",\n",
       "                    \"value\": 80\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"REGENCY CAKESTAND 3 TIER\",\n",
       "                    \"value\": 71\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"SILVER HANGING T-LIGHT HOLDER\",\n",
       "                    \"value\": 65\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"ASSTD DESIGN 3D PAPER STICKERS\",\n",
       "                    \"value\": 60\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"VICTORIAN GLASS HANGING T-LIGHT\",\n",
       "                    \"value\": 51\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"ANGEL DECORATION STARS ON DRESS\",\n",
       "                    \"value\": 48\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"COOK WITH WINE METAL SIGN \",\n",
       "                    \"value\": 48\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"60%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"GOLD MINI TAPE MEASURE \",\n",
       "                \"SMALLFOLKART BAUBLE CHRISTMAS DEC\",\n",
       "                \"CACTI T-LIGHT CANDLES\",\n",
       "                \"HYACINTH BULB T-LIGHT CANDLES\",\n",
       "                \"REGENCY CAKESTAND 3 TIER\",\n",
       "                \"SILVER HANGING T-LIGHT HOLDER\",\n",
       "                \"ASSTD DESIGN 3D PAPER STICKERS\",\n",
       "                \"VICTORIAN GLASS HANGING T-LIGHT\",\n",
       "                \"ANGEL DECORATION STARS ON DRESS\",\n",
       "                \"COOK WITH WINE METAL SIGN \"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"left\": \"2%\",\n",
       "            \"top\": \"15%\",\n",
       "            \"orient\": \"vertical\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u5723\\u8bde\\u8282\\u524d\\u540e\\u88ab\\u9000\\u8d27\\u6570\\u91cf\\u6700\\u591a\\u7684\\u524d\\u5341\\u4e2a\\u4ea7\\u54c1\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_a351912193114272888fc43b0d235750.setOption(option_a351912193114272888fc43b0d235750);\n",
       "        });\n",
       "    </script>\n",
       "<script>\n",
       "        (function() {\n",
       "            containers = document.getElementsByClassName(\"chart-container\");\n",
       "            if(containers.length > 0) {\n",
       "                containers[0].style.display = \"block\";\n",
       "            }\n",
       "        })()\n",
       "\n",
       "        function showChart(evt, chartID) {\n",
       "            let containers = document.getElementsByClassName(\"chart-container\");\n",
       "            for (let i = 0; i < containers.length; i++) {\n",
       "                containers[i].style.display = \"none\";\n",
       "            }\n",
       "\n",
       "            let tablinks = document.getElementsByClassName(\"tablinks\");\n",
       "            for (let i = 0; i < tablinks.length; i++) {\n",
       "                tablinks[i].className = \"tablinks\";\n",
       "            }\n",
       "\n",
       "            document.getElementById(chartID).style.display = \"block\";\n",
       "            evt.currentTarget.className += \" active\";\n",
       "        }\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x12bd3950>"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tab.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
